<template>
  <div>
      <div>
           <el-form :model="upd" title="添加医生"> <br/>
                <el-form-item label="">科室名称：
                    <el-input v-model="upd.divisionName" placeholder="请输入内容" style="width: 500px"></el-input>
                </el-form-item>
                 <el-form-item label="">所属院区：
                    <el-input v-model="upd.floor" placeholder="请输入内容" style="width: 500px"></el-input>
                </el-form-item>
                <el-form-item label="">上级科室：
                   <el-input v-model="upd.floorDirectory" placeholder="请输入内容" style="width: 500px"></el-input>
              </el-form-item>
              <el-form-item label="">科室位置：
                  <el-select v-model="upd.campusName" placeholder="请选择" style="width: 500px" >
                    <el-option
                    v-for="item in options"
                    :key="item.id"
                    :label="item.campusName"
                    :value="item.campusName">
                    </el-option>
                </el-select>
              </el-form-item>
                <el-button @click="updDepartment()" type="primary">确定</el-button>
                <el-button @click="quxiao()" type="primary">取消</el-button>
              </el-form>
      </div>
  </div>
</template>

<script>
export default {
    created(row){
        this.option();
        this.upd=this.$route.query.row
        console.log(row)
    },
    data(){
        return{
            add:{},
            options:[],
            upd:''
        }
    },
    methods:{
        option(){
            this.$axios.get("/user/user/doctor/ren/findDivisionAll").then(res=>{
                this.options=res.data.data.list
            })
        },
        updDepartment(){
            this.$axios.post("/user/user/doctor/ren/updDivision",this.upd).then(res=>{
                this.upd={};
                this.$router.push({path:'/DepartmentManagement' })
            })
        },
        quxiao(){
            this.$router.push({path:'/DepartmentManagement' })
        }
    }
}
</script>

<style>

</style>